<?php
	$connection = mysql_connect("localhost", "root", "zxt@ljj");
	mysql_select_db("light_blogs", $connection);

	$username = $_POST['username'];

	$is_conflict = false;
	$usernames = mysql_query("select username from users");
	while($row = mysql_fetch_array($usernames)) {
		if($username == $row['username']) {
			$is_conflict = true;
			break;
		}
	}

	if($is_conflict) {
		echo 1;
	} else {
		echo 0;
	}
?>